import { defineStore } from 'pinia'

import type { IEditorState } from './type'
import { isCode } from '@/utils/iscode'

const useEditorStore = defineStore('editor', {
  state: ():IEditorState => ({
   editor:{
    title:'',
    content:"",
   }
  }),
  actions: {
    reSet(){
      this.editor.title='',
      this.editor.content=''
    },

},

  persist: {
    paths: ['editor']
  }
})

export default useEditorStore
